import sys
class Solution(object):
    def maxSubArray(self, nums):
        """
        :type nums: List[int]
        :rtype: int
        """
        continueHelp = 0
        max = -sys.maxint
        for i in nums:
            continueHelp =  continueHelp+ i if continueHelp > 0 else i
            max = max if max > continueHelp else continueHelp
        return max